export default {
  state: {
    defaultAvatar: 'http://cba.itlike.com/public/mweb/static/default-avatar.png',
    token: uni.getStorageSync('zh-mall-token') || '',
    userId:''
  },
  getters: {},
  mutations: {
    setUserToken(state,userInfo) {
      state.token = userInfo.token
      state.userId = userInfo.userId
      uni.setStorageSync('zh-mall-token',userInfo.token)
    },
    removeUserToken(state) {
      state.token = ''
      state.userId = ''
      uni.removeStorageSync('zh-mall-token')
    }
  },
  actions: {},
  namespaced:true
}